package com.xfb.main;

import com.xfb.service.HelloService;
import org.apache.dubbo.common.extension.ExtensionLoader;

import java.util.Set;

/**
 * @Auther: Xing Fang Bin
 * @Date: 2021/09/10/17:00
 * @Description:
 */
public class SpiHelloMain {
    public static void main(String[] args) {
        ExtensionLoader<HelloService> extensionLoader = ExtensionLoader.getExtensionLoader(HelloService.class);
        Set<String> extensions = extensionLoader.getSupportedExtensions();
        for (String extension : extensions) {
            String sayHello = extensionLoader.getExtension(extension).sayHello();
            System.out.println(sayHello);
        }
    }
}
